package handler

import (
	"gin-proxy/biz/model"
	"gin-proxy/common/errdef"
	"gin-proxy/common/response"

	"github.com/gin-gonic/gin"
)

func QueryProxy(c *gin.Context) {
	var req model.QueryProxyReq
	if err := c.ShouldBind(&req); err != nil {
		response.Fail(c, errdef.NewParamErr(err.Error()))
		return
	}
	// 查询
	resp := new(model.QueryProxyResp)
	if reqE := c.Query("e"); reqE == "" {
		panic("这是空值")
	} else if reqE == "1" {
		panic(errdef.NewParamErr("e的值不对"))
	}
	response.Ok(c, resp)
}
